function TimeSeries

modx50=load('modx50.out');
modx150=load('modx150.out');
modx250=load('modx250.out');
modx350=load('modx350.out');
modx450=load('modx450.out');
modx550=load('modx550.out');
NNN=length(modx50);
deltak=1/modx50(NNN,1);
kvec=transpose(0:deltak:(NNN-1)*deltak);

datax50=[modx50(:,1) -0.239*modx50(:,2)];
datax150=[modx150(:,1) -0.239*modx150(:,2)];
datax250=[modx250(:,1) -0.239*modx250(:,2)];
datax350=[modx350(:,1) -0.239*modx350(:,2)];
datax450=[modx450(:,1) -0.239*modx450(:,2)];
datax550=[modx550(:,1) -0.239*modx550(:,2)];

NNN=length(modx50);

fftx50=fft(datax50(:,2))/NNN;
fftx150=fft(datax150(:,2))/NNN;
fftx250=fft(datax250(:,2))/NNN;
fftx350=fft(datax350(:,2))/NNN;
fftx450=fft(datax450(:,2))/NNN;
fftx550=fft(datax550(:,2))/NNN;

figure(1)
subplot(6,2,1)
plot(datax50(:,1),datax50(:,2))
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
title('x=50')
subplot(6,2,3)
plot(datax150(:,1),datax150(:,2))
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
title('x=150')
subplot(6,2,5)
plot(datax250(:,1),datax250(:,2))
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
title('x=250')
subplot(6,2,7)
plot(datax350(:,1),datax350(:,2))
ylabel('surface displacement (cm)')
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
title('x=350')
subplot(6,2,9)
plot(datax450(:,1),datax450(:,2))
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
title('x=450')
subplot(6,2,11)
plot(datax550(:,1),datax550(:,2))
axis([-0.1 24 -0.3 0.3])
ax = gca;
ax.XTick = [0 6 12 18 24];
ax.YTick = [-0.3 0  0.3];
xlabel('time (sec)')
title('x=550')

subplot(6,2,2)
semilogy(kvec(2:244),abs(fftx50(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=50')
subplot(6,2,4)
semilogy(kvec(2:244),abs(fftx150(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=150')
subplot(6,2,6)
semilogy(kvec(2:244),abs(fftx250(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=250')
subplot(6,2,8)
semilogy(kvec(2:244),abs(fftx350(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=350')
ylabel('Fourier amplitude (cm)')
subplot(6,2,10)
semilogy(kvec(2:244),abs(fftx450(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=450')
subplot(6,2,12)
semilogy(kvec(2:244),abs(fftx550(2:244)))
axis([-0.2 10.2 10^(-4.5) 10^(-0.5)]);
title('x=550')
xlabel('frequency (Hz)')
